package advanced.design_mode.decoratemode;

//具体装饰类(对饮品的装饰,通过重写方法,其中实现改装饰器特征的东西)
//没有继承装饰器抽象类,自己是一个装饰类
public class Milk implements Drink {
    private Drink drink;

    public Milk(Drink drink) {
//        super(drink);
        this.drink = drink;
    }

    @Override
    public double cost() {
//        return super.cost() + 40;
        return this.drink.cost() + 40;
    }

    @Override
    public String info() {
        return this.drink.info() + "加入了牛奶";
    }
}
